package com.sky.controller.user;

import com.sky.service.DishService;
import com.sky.result.Result;
import com.sky.vo.DishVO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;

@RestController("userDishController")
@Slf4j
public class DishController {

    @Autowired
    DishService dishService;

    /*
    * 根据分类id查询菜品
    * */
    @GetMapping("/user/dish/list")
    public Result<List<DishVO>> list(Long categoryId){
        log.info("根据分类id查询菜品信息：categoryId : {}",categoryId);
        return Result.success(dishService.selectByCategoryIdWithFlavor(categoryId));
    }
}
